<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html lang="en-US">
<head>
	
	<meta http-equiv="Content-Type" content="text/html; charset="UTF-8"" />
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
</head>
<body>
	<%@ include file="top.jsp" %>
   <div class="container" style="margin-top:20px">
		<div class="row">
			<div class="span3">
				<div class="well" style="padding: 8px 0;margin-top:50px;" >
					<ul class="nav nav-list">
						<li class="nav-header">${sessionScope.pu.project.name }</li>
						<li >${sessionScope.user.username }:${sessionScope.pu.role }</li>
						<li class="divider"><br></li>
						<li><a href="project.jspx?id=${sessionScope.pu.projectid }"><i class="icon-home"></i>最新动态</a></li>
						<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
						<li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
						<li ><a href="file.jspx"><i class="icon-file"></i>文件共享</a></li>
						<li class="active"><a href="contact.jspx"><i class="icon-user icon-white"></i>联系人</a></li>
						<li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
						<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
						<li><a href="main.jspx?m=editProject&id=${pu.projectid }"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			
				
			<div style="width:218px;height:252px;border:1px solid gray" id="container"></div> 
			</div>
			<div class="span9" style="margin-bottom:0px;border-radius: 3px 3px 0 0">
				<ul class="breadcrumb" style="margin-top:70px;margin-bottom:0px;border-radius:3px 3px 0 0;border-bottom:none;">
					<li class="active">
						<a href="contact.jspx"><i class="icon-user"></i>联系人</a>
					</li>
				</ul>
				
				<div class="well" style="border-radius:0;border-top:none;">
					<div class="row">
						<div class="span3">
							<a href="contact.jspx?m=addcontact" class="btn span2"><i class="icon-plus"></i>添加联系人</a>
							<div class="clear"></div>
							<ul class="unstyled" style="margin-top:60px">
								<c:forEach items="${requestScope.contactList}" var="c">
									<li style="line-height:30px">
										
										<i class="icon-list-alt"></i>
											
											<a href="javascript:;"  id="${c.id }" class="name">${c.name }</a>
									</li>
								</c:forEach>
								
							</ul>
							
							
							
							
						</div>
						
						
						<div class="span5" style="min-height:400px;border-left:1px solid #ccc;padding-left:15px;position: relative;">
							<div id="code" style="position: absolute; right:0px; top:10px; width: 150px;height:150px; ">
								<img id="2code"   />
							</div>
						
							<address id="ad"></address>
						
							
							<div class="line"><h3>记录</h3></div>
							<br />
							<c:forEach items="${requestScope.notelist }"  var="note">
								<blockquote>
									<p>${note.cont }</p>
									<small>${note.user.username }发表于${note.time}</small>
								</blockquote>
							</c:forEach>
							<a  id ="allNotes">查看所有记录</a>
							<br /><br /><br />
							<a class="btn btn-primary" id="edit"><i class="icon-pencil icon-white"></i>编辑</a>
							<a class="btn btn-danger" id="del"><i class="icon-trash icon-white"></i>删除</a>
							
						</div>
					</div>
				</div>
			</div>
		</div>
		
	</div>
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
	<script type="text/javascript" src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript">
		

		
		
		$(document).ready(function(){
		
		
		 					var map = new BMap.Map("container");
							
							map.addControl(new BMap.NavigationControl());               // 添加平移缩放控件
							map.addControl(new BMap.ScaleControl());                    // 添加比例尺控件
							map.addControl(new BMap.OverviewMapControl()); 
							  var point = new BMap.Point(113.21, 35.238);  // 创建点坐标
 												 map.centerAndZoom(point,10);       
							setTimeout(function(){
								    map.panTo(new BMap.Point(113.21, 35.238));}, 0);
						
			<c:forEach items="${contactList }" var="c"> 
  			$("#${c.id}").click(function(){
  				
  			 	 $.get("contact.jspx?m=ajax&cid=${c.id}",function(data){
  			 	 	$(data).each(function(){
  			 	 		$("#ad").text("");
  			 	 		
  			 	 		$("<h3>").text("姓名："+this.name).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("公司:"+this.company).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("手机:"+this.moblie).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("固话:"+this.tel).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("Email:"+this.email).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("地址:"+this.address).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("微博:"+this.weibo).appendTo($("#ad"));
	  					$("<br>").appendTo($("#ad"));
	  					$("<small>").text("主页:"+this.web).appendTo($("#ad"));
	  					$("#2code").attr("src","code.jspx?cname=${c.id}"+".png");
	  					$("#allNotes").attr("href","contact.jspx?m=shownote&cid=${c.id}" );
  			 	 		$("#edit").attr("href","contact.jspx?m=editcontact&editid=${c.id}" );
						$("#del").attr("href","contact.jspx?m=delcontact&delid=${c.id}" );
  			 	 		 var map = new BMap.Map("container");
							
							map.addControl(new BMap.NavigationControl());               // 添加平移缩放控件
							map.addControl(new BMap.ScaleControl());                    // 添加比例尺控件
							map.addControl(new BMap.OverviewMapControl()); 
							var local = new BMap.LocalSearch(this.address, {
							  renderOptions: {
							    map: map,
							    autoViewport: true,
							    selectFirstResult: false
							  }
							});
							
						
							local.search(this.company); 
  	
  			 	 	
  			 	 	});
				  	
  				});  
  					
  			
  			
  				
			});
  			
  			
  				
		</c:forEach>
  		});
		
	</script>
	
	

	
</body>
</html>

